package cn.app.web.douban;


import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;


import cn.app.entity.DouBanMV;
import cn.app.service.DouBanService;

@Controller
@RequestMapping("/douban")
public class DouBanController{
	
	@Autowired
	private DouBanService douBanService;
	

	
	//查询数据库中所有电影的数据
	@RequestMapping("/douBanList")
	public String appInfoList(Model model){
		
		
		List<DouBanMV> douban = douBanService.findAllMV1();
		
		model.addAttribute("douban",douban);
			
		return "dev/doubandianying";	
	}
	//通过名字查电影
	@RequestMapping("/fornameList")
	public  String fornameList(Model model,
							@RequestParam(value="title",required=false)String title){
		
		List<DouBanMV> douban1 = douBanService.fornameList(title);
		
		model.addAttribute("douban",douban1);
			
		return "dev/doubandianying";
		
	
	}
	
	
}
